package com.ls.socketio.repository.dao;

import com.ls.socketio.bean.RoomBaseInfo;
import com.ls.socketio.repository.RoomBaseRepository;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author liShan
 * @date 2019/9/6 0:35
 */
@Component
public class RoomBaseRepositoryImpl {

    @Resource
    private RoomBaseRepository roomBaseRepository;

    public void add(RoomBaseInfo baseInfo){
        roomBaseRepository.save(baseInfo);
    }

    /**
     * 根据房间id查询
     * @param roomId 房间id
     * @return 查询结果
     */
    public RoomBaseInfo findByRoomId(Long roomId){
        return roomBaseRepository.findByRoomId(roomId);
    }

}
